/**
 * 461. 汉明距离
 */
class Solution3 {
    public int hammingDistance(int x, int y) {
        int tmp = x ^ y, ret = 0;
        while(tmp > 0) {
            if((tmp & 1) == 1) ret++;
            tmp = tmp >> 1;
        }
        return ret;
    }
}